package day06;

public class MethodDemo {
    public static void main(String[] args) {
        say();
        say();
        System.out.println("继续执行");
        sayHi("wkj");
        sayHello("Zhangsan",65);
        sayHello("Lisi",34);
        double a=getNum();
        System.out.println(a);
        int c=plus(2,7);
        System.out.println(c);
        int a1=5,a2=7;
        int c1=plus1(a1,a2);
        System.out.println(c1);

        int[] d=testArray(5,100);
        System.out.println(d.length);
        System.out.println();
        int[] e=testArray(8,100);
        System.out.println(e[0]);
        System.out.println();
        int[] f=testArray(10,10);
        for(int i=0;i<f.length;i++){
            System.out.println(f[i]);
        }
    }








    public static void say(){
        System.out.println("大家好，我叫王克晶，今年39岁了、");
    }
    public static void sayHi(String name){
        System.out.println("大家好，我叫"+name+"，今年39岁了");
    }
    public static void sayHello(String name,int age){
        if(age>60){return;}
        System.out.println("大家好，我叫"+name+"我今年"+age+"岁了");
    }
    public static double getNum(){
        return 8.88;
    }
    public static int plus(int num1,int num2){
        int num=num1+num2;
        return num;
    }
    public static int plus1(int num1,int num2){
        int num=num1+num2;
        return num;
    }
    public static int[] testArray(int len,int max){
        int[] arr=new int[len];
        for(int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*(max+1));
        }
        return arr;
    }
}
